<?php
namespace app\admin\service;

use app\model\ConfigModel;
use think\Service;

class ConfigService extends Service
{

    /**
     * 获取系统设置参数
     * @param $unit_id
     * @param $key
     * @return mixed
     */
    public function getConfig($unit_id,$key): mixed
    {
        $ConfigModel = new ConfigModel();
        $data = $ConfigModel->where([
            'unit_id' => $unit_id,
            'key' => $key
        ])->value('value')??'';
        return json_decode($data,true);
    }
}